/**
* ...
* @author Default
* @version 0.1
*/

package org.anivision.document {
	import de.polygonal.ds.HashTable;
	import org.anivision.AppMain;
	import org.anivision.forms.DocView;

	public class DocumentManager {
		
		private var _docs:HashTable = new HashTable(255);
		private var _views:HashTable = new HashTable(255);
		private var _app:AppMain;
		
		public function DocumentManager(app:AppMain) {
			_app = app;
		}
				
		public function addDocument(doc:Document, show:Boolean = true): void {
			var docView:DocView = new DocView(doc);		
			_views.insert(docView, doc);
			_docs.insert(doc, docView);
			
			if ( show )
			{
				_app.mainform.get_docTab().append(docView);
				docView.init();
			}
		}
		
	}
	
}
